
/**
 * 微信相关配置接口
 * @module wechat
 */

import req from './index'
/**
 * 微信签名 获取当前url
 * @method wxSign
 * @param {url}
 * 
 */
const wxSign = (data) => {
    return req.get('invitation/wechat/sign', data)
}

/**
 * 获取微信用户信息
 * @method getWechatInfo
 * @param {code,phone}
 * 
 */
const getWechatInfo = (data) => {
    return req.get('invitation/wechat/userinfo', data)
}


/**
 * 获取openid
 * @method getOpenid
 * @param {code}
 * 
 */
const getOpenid = (data) => {
    return req.get('invitation/wechat/openid', data)
}


/**
 * 判断openid是否存在
 * @method findOpenid
 * @param {code}
 * 
 */
const findOpenid = (data) => {
    return req.get('invitation/wechat/wechatUser', data)
}

/**
 * 绑定openid
 * @method findOpenid
 * @param {code}
 * 
 */
const bindOpenid = (data) => {
    return req.post('invitation/wechat/bind', data)
}



export { wxSign, getWechatInfo, getOpenid, findOpenid, bindOpenid };